/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Jose Luis
 */
@ManagedBean
@SessionScoped
public class FbController implements Serializable {

    private Map<String, String> fb;
    private List<String> selectedFB;

    /**
     * Creates a new instance of FbController
     */
    public FbController() {
        fb = new TreeMap<String, String>();
        fb.put("User Joel", "joel.lewis.3194");
        fb.put("User Amador", "armando.amador.969");
        fb.put("User JL", "JLBarreche");
        fb.put("User Jaime", "ysasmendi");
        fb.put("User Ana", "ana.alvarezalvargonzalez");
    }

    public void fb(){
        setFb(fb);
    }
    /**
     * @return the fb
     */
    public Map<String, String> getFb() {
        return fb;
    }

    /**
     * @param fb the fb to set
     */
    public void setFb(Map<String, String> fb) {
        this.fb = fb;
    }

    /**
     * @return the selectedFB
     */
    public List<String> getSelectedFB() {
        return selectedFB;
    }

    /**
     * @param selectedFB the selectedFB to set
     */
    public void setSelectedFB(List<String> selectedFB) {
        this.selectedFB = selectedFB;
    }

    public String fbusers() {
        String s = "";
        if (selectedFB != null && selectedFB.size() > 0) {
            s = selectedFB.get(0);
            for (int i = 1; i < selectedFB.size(); i++) {
                s += "," + selectedFB.get(i);
            }
        }
        return s;
    }
}
